package com.wx.nchu_mall.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wx.nchu_mall.dao.CommgoryDao;
import com.wx.nchu_mall.model.Commgory;
import com.wx.nchu_mall.model.PageCondition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommgoryService extends BaseService<CommgoryDao, Commgory> {
    @Autowired
    protected CommgoryDao dao;

    public List<String> findListName(){
        return  dao.findListName();
    }
    public List<Commgory> findList1(){
        return dao.findList1();
    }
    public PageInfo<Commgory> page1(PageCondition<Commgory> condition){
        return PageHelper.startPage(condition.getPageNum(),condition.getPageSize())
                .doSelectPageInfo(()->dao.findViewCommgory(condition.getCondition()));
    }

    public Commgory findOne(Commgory commgory){return dao.findOne(commgory);}



}
